package com.bor.gb.db.domain;

import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.index.Indexed;
import org.springframework.data.mongodb.core.mapping.Document;

import javax.annotation.Nonnull;

/**
 * Created by bor on 18.03.14.
 */
@Document
public class Place {
    @Id
    private String id;

    @Indexed
    private String googlePlaceId;

    @Indexed
    private String name;

    @Indexed
    private String country;

    @Indexed
    private String town;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getCountry() {
        return country;
    }

    public void setCountry(String country) {
        this.country = country;
    }

    public String getTown() {
        return town;
    }

    public void setTown(String town) {
        this.town = town;
    }

    public String getGooglePlaceId() {
        return googlePlaceId;
    }

    public void setGooglePlaceId(String googlePlaceId) {
        this.googlePlaceId = googlePlaceId;
    }

    @Override
    public String toString() {
        return name == null ? country + "_" + town : name;
    }
}
